package Test10;

/**
 * Created by 14229 on 2020/2/21.
 */
public class Bus  extends Reckon{
    private Integer days;
    private Integer num;

    @Override
    public String toString() {
        return getChepaihao() + "," + getPinpai() + "," + getColor() + "," + getShijian() + "," + getCount() + "辆";
    }


    public Bus(String carNumber, String brand, String color, int rent, long time, int count, Integer days, Integer num) {
        super(carNumber, brand, color, rent, time, count);
        this.days = days;
        this.num = num;
    }

    public Integer getDays() {
        return days;
    }

    public void setDays(Integer days) {
        this.days = days;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Bus(String carNumber, String brand, String color, int rent, long time, Integer days, Integer num) {
        super(carNumber, brand, color, rent, time);
        this.days = days;
        this.num = num;
    }

    public Bus() {

    }

    @Override
    public int money(Reckon reckon) {
        // 每天的租金 * 天数
        if(num >=16){
            setZujin(1500);
        }else{
            setZujin(800);
        }

        return getZujin()*days;
    }
}
